package com.lovo.csc.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lovo.csc.bean.VendorBean;
import com.lovo.csc.service.IVendorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("vendor")
public class VendorController {

    @Autowired
    IVendorService vendorService;

    @RequestMapping("findByVendorStatus")
    public Page<VendorBean> findByVendorStatus(Integer pageNO) {
        return vendorService.findByVendorStatus(pageNO);
    }

    @RequestMapping("findById")
    public VendorBean findById(long vendorId) {
        return vendorService.findById(vendorId);
    }

    @RequestMapping("updateVendorStatus")
    public String updateVendorStatus(long vendorId, Integer status, String str) {
        vendorService.updateVendorStatus(vendorId, status, str);
        return "ok";
    }

    @RequestMapping("findAllSupper")
    public List<VendorBean> findAllSupper(){
        return   vendorService.findAllSupper();
    }
}
